home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10102 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  74 lines

  1. Path: wmin.ac.uk!usenet
  2. From: Idoia Lertxundi <gsoec@wmin.ac.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Another a.s.a.p. to do with structures and pointers and arrays
  5. Date: 15 Mar 1996 17:22:02 GMT
  6. Organization: Westminster University
  7. Message-ID: <4ic8vq$fpn@badger.wmin.ac.uk>
  8. NNTP-Posting-Host: ss23.scsise.wmin.ac.uk
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4m)
  13. X-URL: news:comp.lang.c
  14.  
  15. Thank you for the quick response. I am working on it.
  16.  
  17. I have just reached another stuck point. If you have the humour
  18. and the time I would apreciate a hand.
  19.  
  20. Here it goes:
  21.  
  22. I have a struct:
  23.  
  24. typedef struct read_file_module_tag
  25. {
  26. char code[LENGTHCODE];
  27. char module_name[LENGTHMODULE_NAME];
  28. char description[LENGTHDESCRIPTION];
  29. char module_leader[LENGTHLEADER];
  30. char result[LENGTHRESULT];
  31. char corecoursecodes[LENGTHCOURSECODES];
  32. char optionalcoursecodes[LENGTHCOURSECODES];
  33. char andprereqcodes[LENGTHREQUISITES];
  34. char orprereqcodes[LENGTHREQUISITES];
  35. char andcoreqcodes[LENGTHREQUISITES];
  36. char orcoreqcodes[LENGTHREQUISITES];
  37. struct read_file_module_tag *nextfm;
  38. }FILEMODULE;
  39.  
  40. look at the char courecoursecodes[XXX] O.K.?
  41.  
  42. then reading a name1,name2,name3 list with strtok fuction
  43. I have stored them in a 
  44.  
  45.     char *ccoursecodes[10];
  46.  
  47. then when I try do this copy:
  48.  
  49.     strcpy(mlst->corecoursecodes[i],ccoursecodes[i]);
  50. the thing goes wrong no casting for argumenet 1.
  51. and if I change the above structure char type to char *...[]
  52. does compile but it gives a segmentation fault when running.
  53. Help!! S.O.S.
  54.  
  55. If replying send responses to the newsgroup and to me
  56. gsoec@wmin.ac.uk
  57. -- 
  58.  
  59. [~~~]|~~~\  /~~\ [~~~] /~~\       /~~] /~~~] /~~\ |~~~] /~~~]
  60.  ] [ | [) )( () ) ] [ | () | --- | [~~|\_ ~\( () )| ~] ( (_~
  61. [___]|___/  \__/ [___]|_||_|      \___|[___/ \__/ |___] \___]
  62.  
  63.                 ///      
  64.                (0 0)     
  65. ------------ooO-(_)-Ooo------------------------
  66.  
  67. Ms Idoia Lertxundi
  68.  
  69. Personal mail:   gsoec@wmin.ac.uk
  70. WWW Page:        http://www.wmin.ac.uk/~gsoec/
  71.  
  72. -----------------------------------------------
  73.  
  74.